* ==============================================================================
* ==============================================================================
* Title: Evaulating the effects of IMF conditionality: An extension of quantitative approaches and an empirical application to public education spending
* Authors: Thomas Stubbs, Alexander Kentikelenis, Bernhard Reinsberg, Lawrence King
* Version: Final (16 October 2018)
* ==============================================================================
* ==============================================================================

* ==============================================================================
* Generate variables
* ==============================================================================
cd "D:\Dropbox\CPEST\IMFMETH\"
* Change location to directory where files were unzipped
xtset cid year 
gen govbal = govrev - govexp
gen IMFliq = ln(imf_liquidity_ratio)
gen lngdppc = ln(gdppc_WDI)
gen nhigh = income_WB=="L" | income_WB=="LM" | income_WB=="UM"
replace nhigh = l.nhigh if year==2014
egen IMFunder = sum(IMF55), by(year)
gen yr3IMF55 = IMF55 + l.IMF55 + l2.IMF55
egen groupIMFunder = sum(yr3IMF55), by(year income_WB region_WDI)
egen varBA2TOT=mean(BA2TOT) if year>=1990 & year<=2014, by(cid)
gen intBA2TOT=varBA2TOT*IMFliq
gen SCsBA2 = SPCsTOT + PAsTOT
gen QCsBA2 = QPCsTOT
egen varSCsBA2=mean(SCsBA2) if year>=1990 & year<=2014, by(cid)
gen intSCsBA2=varSCsBA2*IMFliq
egen varQCsBA2=mean(QCsBA2) if year>=1990 & year<=2014, by(cid)
gen intQCsBA2=varQCsBA2*IMFliq
foreach cond in BA2DEB BA2ENV BA2EXT BA2FIN BA2FP BA2INS BA2LAB BA2OTH BA2POV BA2PRI BA2RTP BA2SOE BA2SP {
	egen var`cond'=mean(`cond') if year>=1990 & year<=2014, by(cid)
	gen int`cond'=var`cond'*IMFliq
	gen res`cond' = BA2TOT - `cond'
	egen varres`cond'=mean(res`cond') if year>=1990 & year<=2014, by(cid)
	gen intres`cond'=varres`cond'*IMFliq
}
egen varcBATOT=mean(cBATOT) if year>=1990 & year<=2008, by(cid)
gen intcBATOT=varcBATOT*IMFliq
egen vardBA2TOT=mean(dBA2TOT) if year>=1990 & year<=2008, by(cid)
gen intdBA2TOT=vardBA2TOT*IMFliq
egen varBA1TOT=mean(BA1TOT) if year>=1990 & year<=2014, by(cid)
gen intBA1TOT=varBA1TOT*IMFliq
gen LIMF55 = l.IMF55
egen varIMF55=mean(IMF55) if year>=1990 & year<=2014, by(cid)
gen intIMF55=varIMF55*IMFliq
egen cbvarIMF55=mean(IMF55) if year>=1990 & year<=2008, by(cid)
gen cbintIMF55=cbvarIMF55*IMFliq

* ==============================================================================
* Figure 1. IMF liquidity ratio and mean number of conditions per year, 1990-2014
* ==============================================================================
xtset cid year
egen BA2under = sum(BA2TOT), by(year)
gen BA2avg = BA2under/IMFunder
corr BA2avg IMFliq if year>=1990 & year<=2014
local r: display %5.2f r(rho)
scatter BA2avg IMFliq if year>=1990 & year<=2014, scheme(s1mono) mlabel(year) mlabpos(12)|| lfit BA2avg IMFliq if year>=1990 & year<=2014, legend(off) ytitle("Mean number of conditions") xtitle("Natural log of IMF liquidity ratio") ylabel(, angle(0)) note(r = `r', size(medsmall) placement(se))
graph export "Figures\IMFMETH_Figure1.png", replace width(4000)

* ==============================================================================
* Figure 2. IMF liquidity ratio and number of conditions per country-year for low, medium, and high conditionality countries, 1990-2014
* ==============================================================================
egen BA2country = sum(BA2TOT) if year>=1990 & year<=2014, by(cname)
egen IMFcountry = sum(IMF55) if year>=1990 & year<=2014 & BA2TOT>0, by(cname)
gen BA2couavg = BA2country/IMFcountry if year>=1990 & year<=2014
egen condcat = cut(BA2couavg), group(3)
label var condcat "Low, Medium or High Conditionality"
label define Cond 0 "Low" 1 "Medium" 2 "High"
label values condcat Cond
egen ccodeyear = concat(ccode year)
corr BA2TOT IMFliq if BA2TOT>0 & !missing(BA2TOT) & year>=1990 & year<=2014
corr BA2TOT IMFliq if BA2TOT>0 & !missing(BA2TOT) & condcat==0 & year>=1990 & year<=2014
corr BA2TOT IMFliq if BA2TOT>0 & !missing(BA2TOT) & condcat==1 & year>=1990 & year<=2014
corr BA2TOT IMFliq if BA2TOT>0 & !missing(BA2TOT) & condcat==2 & year>=1990 & year<=2014
scatter BA2TOT IMFliq if BA2TOT>0 & !missing(BA2TOT) & year>=1990 & year<=2014, scheme(s1mono) msize(tiny) mlabel(ccodeyear) mlabpos(12) mlabsize(tiny) || lfit BA2TOT IMFliq if BA2TOT>0 & !missing(BA2TOT) & year>=1990 & year<=2014, lwidth(thick) by(condcat, total row(1)) ytitle("Number of conditions") xtitle("Natural log of IMF liquidity ratio") ylabel(, angle(0))
graph export "Figures\IMFMETH_Figure2.png", replace width(4000)

* ==============================================================================
* Figure 3. Parallel trends in IMF conditionality compound instrument
* ==============================================================================
preserve
egen expBA=mean(BA2TOT), by(cid)
drop if expBA==0 | year<1990
keep if nhigh
su expBA, d
g highBA=(expBA>`r(p50)')
collapse (mean)IMFliq IMFunder IMF55 BA2TOT egdp_wdi, by(year highBA)
reshape wide IMFliq IMFunder IMF55 BA2TOT egdp_wdi, i(year) j(highBA)
line BA2TOT1 BA2TOT0 year, scheme(s1mono) lwidth(thick thick) ytitle("Mean number of conditions") ylabel(, angle(0)) xlabel(1990(6)2014) name(g1) legend(off)
line egdp_wdi1 egdp_wdi0 year, scheme(s1mono) lwidth(thick thick) ytitle("Government education spending (% of GDP)") ylabel(0(2)8, angle(0)) xlabel(1990(6)2014) name(g2) legend(label(1 "Above mean exposure") label(2 "Below mean exposure"))
grc1leg g1 g2, legendfrom(g2) scheme(s1mono) xcommon iscale(1)
graph export "Figures\IMFMETH_Figure3.png", replace width(4000)
graph drop g1 g2
restore

* ==============================================================================
* Figure 4. IMF liquidity ratio across time, 1990-2014
* ==============================================================================
preserve
egen expBA=mean(BA2TOT), by(cid)
drop if expBA==0 | year<1990
keep if nhigh
su expBA, d
g highBA=(expBA>`r(p50)')
collapse (mean)IMFliq IMFunder IMF55 BA2TOT egdp_wdi, by(year highBA)
reshape wide IMFliq IMFunder IMF55 BA2TOT egdp_wdi, i(year) j(highBA)
line IMFliq0 year, scheme(s1mono) lwidth(thick) ytitle("Natural log of IMF liquidity ratio") ylabel(, angle(0)) xlabel(1990(6)2014)
graph export "Figures\IMFMETH_Figure4.png", replace width(4000)
restore

* ==============================================================================
* Figure 5. Parallel trends in IMF participation compound instrument
* ==============================================================================
preserve
egen nimf=sum(IMF55), by(cid)
drop if nimf==0 | year<1990
keep if nhigh
su nimf, d
g imfhigh=(nimf>`r(p50)')
collapse (mean)IMFliq IMFunder IMF55 BA2TOT egdp_wdi, by(year imfhigh)
reshape wide IMFliq IMFunder IMF55 BA2TOT egdp_wdi, i(year) j(imfhigh)
line IMF551 IMF550 year, scheme(s1mono) lwidth(thick thick) ytitle("Probability of IMF program participation") ylabel(0(.2)1, angle(0)) xlabel(1990(6)2014) name(g1) legend(off)
line egdp_wdi1 egdp_wdi0 year, scheme(s1mono) lwidth(thick thick) ytitle("Government education spending (% of GDP)") ylabel(0(2)8, angle(0)) xlabel(1990(6)2014) name(g2) legend(label(1 "Above mean exposure") label(2 "Below mean exposure"))
grc1leg g1 g2, legendfrom(g2) scheme(s1mono) xcommon iscale(1)
graph export "Figures\IMFMETH_Figure5.png", replace width(4000)
graph drop g1 g2
restore

* ==============================================================================
* Table 2. Effect of IMF conditionality on government education spending
* Appendix E. First-stage models for effect of IMF conditionality on government education spending
* ==============================================================================
xtset cid year
cmp setup
local ctrl "lngdppc urban dratio fhip l.govbal l.trade"
eststo: reg egdp_wdi `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth), cluster(cid)
eststo: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth), cluster(cid)
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT lngdppc urban dratio i.cid ib2000.year) (LIMF55 = l.intIMF55 lngdppc urban dratio i.cid ib2000.year) (cond: l.BA2TOT = l.intBA2TOT lngdppc urban dratio i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' i.cid ib2000.year) (cond: l.BA2TOT = l.intBA2TOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT lngdppc urban dratio i.cid ib2000.year) (LIMF55 = l.intIMF55 lngdppc urban dratio ib2000.year) (cond: l.BA2TOT = l.intBA2TOT lngdppc urban dratio i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_probit $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' ib2000.year) (cond: l.BA2TOT = l.intBA2TOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_probit $cmp_cont) cl(cid) iterate(50) difficult
* Output
esttab, b(4) se(4) nogaps brackets star(* 0.10 ** 0.05 *** 0.01) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est3
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
test ([LIMF55]l.intIMF55 [cond]l.intBA2TOT)
estimates restore est4
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
test ([LIMF55]l.intIMF55 [cond]l.intBA2TOT)
estimates restore est5
test ([cond] l.intBA2TOT)
estimates restore est6
test ([cond] l.intBA2TOT)
eststo clear

* ==============================================================================
* Table 3. Effect of IMF conditionality on government education spending, disaggregated conditions
* Appendix F. First-stage models for effect of IMF conditionality on government education spending, disaggregated condition
* ==============================================================================
xtset cid year
cmp setup
local ctrl "lngdppc urban dratio fhip l.govbal l.trade"
qui: reg egdp_wdi LIMF55 l.SCsBA2 l.QCsBA2 `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth)
eststo: cmp (egdp_wdi = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' i.cid ib2000.year) (cond: l.SCsBA2 = l.intSCsBA2 `ctrl' i.cid ib2000.year) (res: l.QCsBA2 = l.intQCsBA2 `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' ib2000.year) (cond: l.SCsBA2 = l.intSCsBA2 `ctrl' i.cid ib2000.year) (res: l.QCsBA2 = l.intQCsBA2 `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_probit $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2FP l.resBA2FP `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' i.cid ib2000.year) (cond: l.BA2FP = l.intBA2FP `ctrl' i.cid ib2000.year) (res: l.resBA2FP = l.intresBA2FP `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2FP l.resBA2FP `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' ib2000.year) (cond: l.BA2FP = l.intBA2FP `ctrl' i.cid ib2000.year) (res: l.resBA2FP = l.intresBA2FP `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_probit $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2RTP l.resBA2RTP `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' i.cid ib2000.year) (cond: l.BA2RTP = l.intBA2RTP `ctrl' i.cid ib2000.year) (res: l.resBA2RTP = l.intresBA2RTP `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2RTP l.resBA2RTP `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' ib2000.year) (cond: l.BA2RTP = l.intBA2RTP `ctrl' i.cid ib2000.year) (res: l.resBA2RTP = l.intresBA2RTP `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_probit $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* Output
esttab, b(4) se(4) nogaps brackets star(* 0.10 ** 0.05 *** 0.01) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est1
test ([cond] l.intSCsBA2)
test ([res] l.intQCsBA2)
test ([LIMF55] l.intIMF55)
test ([LIMF55]l.intIMF55 [cond]l.intSCsBA2 [res]l.intQCsBA2)
estimates restore est2
test ([cond] l.intSCsBA2)
test ([res] l.intQCsBA2)
test ([cond]l.intSCsBA2 [res]l.intQCsBA2)
estimates restore est3
test ([cond] l.intBA2FP)
test ([res] l.intresBA2FP)
test ([LIMF55] l.intIMF55)
test ([LIMF55]l.intIMF55 [cond]l.intBA2FP [res]l.intresBA2FP)
estimates restore est4
test ([cond] l.intBA2FP)
test ([res] l.intresBA2FP)
test ([cond]l.intBA2FP [res]l.intresBA2FP)
estimates restore est5
test ([cond] l.intBA2RTP)
test ([res] l.intresBA2RTP)
test ([LIMF55] l.intIMF55)
test ([LIMF55]l.intIMF55 [cond]l.intBA2RTP [res]l.intresBA2RTP)
estimates restore est6
test ([cond] l.intBA2RTP)
test ([res] l.intresBA2RTP)
test ([cond]l.intBA2RTP [res]l.intresBA2RTP)
eststo clear

* ==============================================================================
* Table 4. Robustness checks for effect of IMF conditionality on government education spending
* Appendix G. First-stage models for robustness checks for effect of IMF conditionality on government education spending
* ==============================================================================
xtset cid year
cmp setup
local ctrl "lngdppc urban dratio fhip l.govbal l.trade"
qui: reg egdp_wdi LIMF55 l.cBATOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2008 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth)
eststo: cmp (egdp_wdi = LIMF55 l.cBATOT `ctrl' i.cid ib2000.year) (LIMF55 = l.cbintIMF55 `ctrl' i.cid ib2000.year) (cond: l.cBATOT = l.intcBATOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2008 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.dBA2TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.cbintIMF55 `ctrl' i.cid ib2000.year) (cond: l.dBA2TOT = l.intdBA2TOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2008 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
qui: reg egdp_wdi LIMF55 l.BA1TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth)
eststo: cmp (egdp_wdi = LIMF55 l.BA1TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' i.cid ib2000.year) (cond: l.BA1TOT = l.intBA1TOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
qui: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth) & !missing(ac_lntot110)
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT ac_lntot110 `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 ac_lntot110 `ctrl' i.cid ib2000.year) (cond: l.BA2TOT = l.intBA2TOT ac_lntot110 `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT ac_lntot110 `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 ac_lntot110 `ctrl' ib2000.year) (cond: l.BA2TOT = l.intBA2TOT ac_lntot110 `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_probit $cmp_cont) cl(cid) iterate(50) difficult
qui: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth) & !missing(l.groupIMFunder)
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT l.groupIMFunder `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 l.groupIMFunder `ctrl' i.cid ib2000.year) (cond: l.BA2TOT = l.intBA2TOT l.groupIMFunder `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
qui: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth) & !missing(l.unga)
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.unga `ctrl' i.cid ib2000.year) (cond: l.BA2TOT = l.intBA2TOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
qui: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth) & !missing(l.unsc)
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.unsc `ctrl' i.cid ib2000.year) (cond: l.BA2TOT = l.intBA2TOT `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
qui: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth) & !missing(l.unga) & !missing(l.unsc)
eststo: cmp (egdp_wdi = LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year) (LIMF55 = l.intIMF55 `ctrl' i.cid ib2000.year) (cond: l.BA2TOT = l.unga l.unsc `ctrl' i.cid ib2000.year) if year>=1990 & year<=2014 & nhigh & e(sample), indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* Output
esttab, b(4) se(4) nogaps brackets star(* 0.10 ** 0.05 *** 0.01) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est1
test ([cond] l.intcBATOT)
test ([LIMF55] l.cbintIMF55)
test ([cond]l.intcBATOT [LIMF55]l.cbintIMF55)
estimates restore est2
test ([cond] l.intdBA2TOT)
test ([LIMF55] l.cbintIMF55)
test ([cond]l.intdBA2TOT [LIMF55] l.cbintIMF55)
estimates restore est3	
test ([cond] l.intBA1TOT)
test ([LIMF55] l.intIMF55)
test ([cond] l.intBA1TOT [LIMF55] l.intIMF55)
estimates restore est4	
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
test ([cond] l.intBA2TOT [LIMF55] l.intIMF55)
estimates restore est5	
test ([cond] l.intBA2TOT)
estimates restore est6	
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
test ([cond] l.intBA2TOT [LIMF55] l.intIMF55)
estimates restore est7
test ([cond] l.intBA2TOT)
test ([LIMF55] l.unga)
test ([cond]l.intBA2TOT [LIMF55]l.unga)
estimates restore est8
test ([cond] l.intBA2TOT)
test ([LIMF55] l.unsc)
test ([cond]l.intBA2TOT [LIMF55]l.unsc)
estimates restore est9
test ([cond] l.unga l.unsc)
test ([LIMF55] l.intIMF55)
test ([cond]l.unga l.unsc [LIMF55]l.intIMF55)
eststo clear	

* ==============================================================================
* Appendix B. Table B1. Number of conditions by policy area, 1990-2014
* ==============================================================================
tabstat BA2FP BA2RTP BA2FIN BA2SOE BA2PRI BA2DEB BA2EXT BA2LAB BA2SP BA2POV BA2INS BA2ENV BA2OTH if year>=1990 & year<=2014, s(sum)
tabstat BA1FP BA1RTP BA1FIN BA1SOE BA1PRI BA1DEB BA1EXT BA1LAB BA1SP BA1POV BA1INS BA1ENV BA1OTH if year>=1990 & year<=2014, s(sum)

* ==============================================================================
* Appendix D. Summary statistics of the variables used in empirical analysis
* ==============================================================================
foreach var of varlist BA2TOT BA2FP BA2RTP IMFliq IMFunder unga lngdppc urban dratio fhip growth govbal trade {
	gen L`var' = l.`var'
}
local ctrl "lngdppc urban dratio fhip l.govbal l.trade"
qui: reg egdp_wdi LIMF55 l.BA2TOT `ctrl' i.cid ib2000.year if year>=1990 & year<=2014 & nhigh & !missing(lngdppc) & !missing(urban) & !missing(dratio) & !missing(fhip) & !missing(l.govbal) & !missing(l.trade) & !missing(l.growth), cluster(cid)
tabstat egdp_wdi LBA2TOT LBA2FP LBA2RTP LIMF55 lngdppc urban dratio fhip Lgovbal Ltrade LIMFliq if e(sample), s(n mean sd mi ma) col(s)

*=============================================